package com.tsd.jxc.sale.service;

import com.tsd.core.vo.HttpResult;
import com.tsd.core.vo.PageBean;
import com.tsd.jxc.sale.entity.JxcSaleOrder;
import com.tsd.jxc.sale.entity.JxcSaleOrderExt;
import com.tsd.jxc.sale.entity.JxcSaleReturnBillExt;
import com.tsd.jxc.vo.JxcSettingVo;
import com.tsd.system.entity.SysUser;
import com.tsd.system.entity.SysUserExt;

import java.util.List;
import java.util.Map;

/**
 * 描述：JxcSaleOrder服务实现层接口
 *
 * @author Hillpool
 * @date 2022/07/29 15:04:27
 */
public interface JxcSaleOrderService {

    /**
     * 描述：根据id获取JxcSaleOrder
     *
     * @param id
     */
    JxcSaleOrder getJxcSaleOrderById(Long id) throws Exception;

    /**
     * 描述：根据sid获取JxcSaleOrder
     *
     * @param sid
     */
    JxcSaleOrderExt queryBySid(String sid) throws Exception;

    /**
     * 描述：根据sid列表删除JxcSaleOrder
     *
     * @param list
     */
    void deleteJxcSaleOrders(List<String> list, SysUser opUser) throws Exception;

    /**
     * 描述：保存或更新JxcSaleOrder
     *
     * @param record
     * @param opUser
     */
    void saveJxcSaleOrder(JxcSaleOrderExt record, SysUser opUser) throws Exception;

    void checkBuyStock(JxcSaleOrderExt record) throws Exception;

    /**
     * 描述：根据params分页查询JxcSaleOrder
     *
     * @param params
     * @param page
     */
    List<JxcSaleOrderExt> findJxcSaleOrders(Map<String, Object> params, PageBean page) throws Exception;

    /**
     * 描述：根据params分页查询JxcSaleOrder
     *
     * @param params
     */
    List<JxcSaleOrderExt> findJxcSaleOrders(Map<String, Object> params) throws Exception;

    void changeJxcSaleOrderAuditState(List<String> sidList, Integer state, JxcSettingVo settingVo, SysUserExt opUser) throws Exception;

    HttpResult<Object> changeJxcSaleOrderAuditStateWithCheckStock(List<String> sidList, Integer state, String execute, String related_audit, SysUserExt opUser) throws Exception;

    void genJxcSaleOrder2OutBill(List<String> sidList, SysUserExt opUser) throws Exception;

    void genJxcSaleOrder2ReturnBill(List<String> sidList, SysUserExt opUser) throws Exception;

    JxcSaleReturnBillExt getJxcSaleOrder2ReturnBillData(String sid) throws Exception;

    /**
     * 根据销售订单sid列表生成对账单
     *
     * @param sidList
     * @param opUser
     * @return
     * @throws Exception
     */
    Integer genJxcFinanceAccountDetail4Sale(List<String> sidList, SysUserExt opUser) throws Exception;

    /**
     * 导出-包含明细
     *
     * @param params
     * @param page
     * @return
     */
    List<JxcSaleOrderExt> findJxcSaleOrdersIncludeDetail(Map<String, Object> params, PageBean page);

    List<JxcSaleOrderExt> queryJxcSaleOrderData4Print(List<String> sidList) throws Exception;

    List<JxcSaleOrderExt> queryXdSaleOrderData4Print(List<String> sidList) throws Exception;

    void cancelJxcSaleOrder(List<String> sidList, SysUserExt opUser) throws Exception;

    List<JxcSaleOrderExt> queryXdSaleOrderData4CalTax() throws Exception;

}
